<?php
/**
 * @Author: laoweizhen <1149243551@qq.com>,
 * @Date: 2021/10/27 18:38,
 * @LastEditTime: 2021/10/27 18:38
 */

namespace Lwz\LaravelExtend\MQ\Repositories;


use Lwz\LaravelExtend\MQ\Models\MQErrorLog;

class MQErrorLogRepository extends RepositoryAbstract
{
    protected static string $model = MQErrorLog::class;


    /**
     * 通过 uuid 删除消息
     * @param string|array $mqUuid mq唯一标识（多个传数组）
     * @return mixed
     * @auth lwz
     */
    public static function deleteByMQUuid($mqUuid)
    {
        // 批量删除
        if (is_array($mqUuid)) {
            return MQErrorLog::whereIn('mq_uuid', $mqUuid)->delete();
        }

        // 删除单个
        return self::deleteByWhere(['mq_uuid' => $mqUuid]);
    }
}